import 'package:flutter/material.dart';

class SliderHomePage extends StatefulWidget {
  @override
  _SliderHomePageState createState() => _SliderHomePageState();
}

class _SliderHomePageState extends State<SliderHomePage> {
  double value = 50;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('slider')),
      body: Container(
          height: 300,
          alignment: Alignment.center,
          child: Slider(
              value: value,
              min: 0,
              max: 100,
              label: "这是label",
              activeColor: Colors.green,
              inactiveColor: Colors.grey,
              onChanged: (v) {
                setState(() {
                  value = v;
                });
              })),
    );
  }
}
